#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
string add(string s1, string s2)
{
	int len1 = s1.length();
	int len2 = s2.length();
	int len = len1 > len2 ? len2 : len1;
	string s3 = "";
	int flag = 0;
	int i = 0;
	int j = s1.length() - 1;
	int k = s2.length() - 1;
	while (i < len)
	{
		int x = (s1[j] - '0') + (s2[k] - '0') + flag;
		flag = x / 10;
		x %= 10;
		s3.insert(0, 1, x + '0');
		j--, k--, i++;
	}
	if (j >= 0)
	{
		if (flag == 1)
		{
			s1[j]++;
		}
		int n = len1 - len2;
		for (int i = n; i > 0; i--)
		{
			s3.insert(0, 1, s1[i-1] );
		}
	}
	else
	{
		if (flag == 1)
		{
			s2[k]++;
		}
		int n = len2 - len1;
		for (int i = n; i > 0; i--)
		{
			s3.insert(0, 1, s2[i-1] );
		}
	}
	return s3;
}
int main()
{
	string s1 = "227";
	string s2 = "465";
	string s3=add(s1, s2);
	cout << s3 << endl;
	return 0;
}